#ifndef GAMEBOARD_H
#define GAMEBOARD_H

#include <QGraphicsView>
#include <QMap>

enum GridType {
    Normal, BackToStart, ExtraTurn,
    Forward3, Backward5, TeleportEnd
};

class GameBoard : public QGraphicsView {
    Q_OBJECT
public:
    explicit GameBoard(QWidget *parent = nullptr);
    void movePlayer(int playerId, int position);
    void reset();
    void setPlayerVisible(int playerId, bool visible);
    GridType getGridType(int position) const;

    static constexpr int GRID_SIZE = 60;
    static constexpr int BOARD_SIZE = 9;

private:
    QGraphicsScene* m_scene;
    QGraphicsEllipseItem* m_players[3];
    QMap<int, GridType> m_specialGrids;

    QPointF calculatePosition(int pos) const;
    void initializeSpecialGrids();
    void createGrid();
};

#endif // GAMEBOARD_H
